<?php
// +-------------------------------------------------------------------
// |
// +-------------------------------------------------------------------
// | Copyright (c) 2009-2016 All rights reserved.
// +-------------------------------------------------------------------
namespace Service\User;

class News extends \Service\Common\BaseModel
{
    protected $name = 'news';


    //列表
    public function NewsLists($type_id, $page_num, $page_size)
    {

        $where = ['type_id' => $type_id];
        $list = (array)$this->order('id desc')
            ->where(['type_id' => $type_id])
            ->page($page_num, $page_size)->select();
        $count = $this->count();
        return [
            $list,
            $page_count = $count,
            $page_total = ceil($count / $page_size)
        ];
    }
}